// This class has the needed functions to power up Ogre and offers the standard
// behavior such as making screenshots and creating the debug overlays. It 
// contains most of the Ogre related variables. 
// 
// It also has functions to handle input, however the input is handled in the 
// application states rather than here. Anything common to the entire application
// can be used here.

// Precompiler defines
#ifndef OGRE_FRAMEWORK_HPP
#define OGRE_FRAMEWORK_HPP

// Ogre standard files
#include <OgreCamera.h>
#include <OgreEntity.h>
#include <OgreLogManager.h>
#include <OgreOverlay.h>
#include <OgreOverlayElement.h>
#include <OgreOverlayManager.h>
#include <OgreRoot.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
#include <OgreConfigFile.h>
 
// OIS standard files
#include <OISEvents.h>
#include <OISInputManager.h>
#include <OISKeyboard.h>
#include <OISMouse.h>

// SDK Tray
#include <SdkTrays.h>

class OgreFramework : public Ogre::Singleton<OgreFramework>, OIS::KeyListener, OIS::MouseListener, OgreBites::SdkTrayListener
{
	public:

		// Constructor/Destructor
		OgreFramework();
		~OgreFramework();

		// Start and update Ogre functions
		bool initOgre(Ogre::String wndTitle, OIS::KeyListener* pKeyListener = 0, OIS::MouseListener* pMouseListener = 0);
		void updateOgre(double timeSinceLastFrame);

		// OIS Keyboard overrides
		bool keyPressed(const OIS::KeyEvent& keyEventRef);
		bool keyReleased(const OIS::KeyEvent& keyEventRef);

		// OIS Mouse overrides
		bool mouseMoved(const OIS::MouseEvent &evt);
		bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
		bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);

		// Essential Ogre pointers
		Ogre::Root*						m_pRoot;
		Ogre::RenderWindow*				m_pRenderWnd;
		Ogre::Viewport*					m_pViewport;
		Ogre::Log*						m_pLog;
		Ogre::Timer*					m_pTimer;

		// Essential OIS input pointers
		OIS::InputManager*				m_pInputMgr;
		OIS::Keyboard*					m_pKeyboard;
		OIS::Mouse*						m_pMouse;

		// SDK Tray stuff, used for debug mostly.
		OgreBites::SdkTrayManager*		m_pTrayMgr;

	// Not sure what these are for.
	private:

		OgreFramework(const OgreFramework&);
		OgreFramework& operator = (const OgreFramework&);

		bool							m_bIsOverlayEnabled;
};

#endif